﻿namespace NAGFwk.BL
{
    using System;
    using System.Collections.Generic; 
    using NAGFwk.Templates;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    public partial class AddressController : NAGFwk.BL.IBaseController<Model.Address>
    {
    
           private readonly SilkeyERP.Model.AddressRepository Repository;
    
            public AddressController()
            {
                    this.Repository = new Model.AddressRepository();
            }
    
    		public struct AddressRelatedEntities
            {
                			   
    			      public string AddressBank { get { return "AddressBank"; } }
    			  			   
    			      public string AddressCustomer { get { return "AddressCustomer"; } }
    			          }
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public NAGFwk.Templates.Address GetAddressWithAllChilds(int AddressID) 
            {
    				 return this.Repository.GetAddressWithAllChilds(AddressID);
    		}
    			
            public NAGFwk.Templates.Address GetAddress(int AddressID) 
            {
    		    return this.Repository.GetAddress(AddressID); 
    		}
    				public List<NAGFwk.Templates.Address> GetAll() 
            {
    		    return this.Repository.GetAll().Where(x => x.Enable == true).ToList();
    		}
    				  public Address GetByID(int ID)
            {
                return this.Repository.GetByID(ID);
            }
    		//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				   
    
    		public NAGFwk.Templates.Address GetAddressWithAddressBank(int AddressID) 
    		{
    		    return this.Repository.GetAddressWithAddressBank(AddressID);  
    		}			
    
    			  			   
    
    		public NAGFwk.Templates.Address GetAddressWithAddressCustomer(int AddressID) 
    		{
    		    return this.Repository.GetAddressWithAddressCustomer(AddressID);  
    		}			
    
    			  	    //*****************************************************************************************
    		//***************************CRUD Operations***********************************************
    		//*****************************************************************************************
    		#region "Delete"
    		
            public void DeleteLogical(int ID)
            {
                this.Repository.DeleteLogical(ID);
            }
    
    		 public void Delete(NAGFwk.Templates.Address Obj)
            {
                Delete(Obj.AddressID);
            }
    
            public void DeleteLogical(NAGFwk.Templates.Address Obj)
            {
                DeleteLogical(Obj.AddressID);
            }
    	
            public void Delete(int AddressID) 
    		{
    			this.Repository.Delete(AddressID);  
    		}
    
    		//public void Delete(NAGFwk.Templates.Address MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			//this.Repository.Delete(MyObj,Tran);  
    		//}
    
    		//public void TransactionalDelete(NAGFwk.Templates.Address MyObj) 
    		//{
    			//this.Repository.TransactionalDelete(MyObj);  
    		//}
    		#endregion
    
    		#region "Insert"
    				  public void Insert(NAGFwk.Templates.Address Obj)
            {
                Obj.Enable = true;
                this.Repository.Insert(Obj);
            }
    			    //public NAGFwk.Templates.Address Insert(NAGFwk.Templates.Address MyObj) 
    		//{
    			//return this.Repository.Insert(MyObj);  
    		//}
    
    		//public IList<NAGFwk.Templates.Address> Insert(List<NAGFwk.Templates.Address> MyObjs) 
    		//{
    		//return	this.Repository.Insert(MyObjs);  
    		//}
    		
    		//public void Insert(NAGFwk.Templates.Address MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			//this.Repository.Insert(MyObj,Tran);  
    		//}
    		
    		//public void TransactionalInsert(NAGFwk.Templates.Address MyObj) 
    		//{
    			 //this.Repository.TransactionalInsert(MyObj);  
    		//}
    		#endregion
    
    		#region "Update"	
    		
    	    public void Update(NAGFwk.Templates.Address MyObj) 
    		{
    			 this.Repository.Update(MyObj);  
    		}		
    		
    		//public void Update(NAGFwk.Templates.Address MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			 //this.Repository.Update(MyObj,Tran);  
    		//}
    		
    		//public void TransactionalUpdate(NAGFwk.Templates.Address MyObj) 
    		//{
    			 //this.Repository.TransactionalUpdate(MyObj);  
    		//}
    		#endregion
    
    }
}
namespace NAGFwk.BL
{
    using System;
    using System.Collections.Generic; 
    using NAGFwk.Templates;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    public partial class AddressBankController : NAGFwk.BL.IBaseController<Model.AddressBank>
    {
    
           private readonly SilkeyERP.Model.AddressBankRepository Repository;
    
            public AddressBankController()
            {
                    this.Repository = new Model.AddressBankRepository();
            }
    
    		public struct AddressBankRelatedEntities
            {
                			   
    			      public string Address { get { return "Address"; } }
    			          }
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public NAGFwk.Templates.AddressBank GetAddressBankWithAllChilds(int AddressID,int BankID) 
            {
    				 return this.Repository.GetAddressBankWithAllChilds(AddressID,BankID);
    		}
    			
            public NAGFwk.Templates.AddressBank GetAddressBank(int AddressID,int BankID) 
            {
    		    return this.Repository.GetAddressBank(AddressID,BankID); 
    		}
    				public List<NAGFwk.Templates.AddressBank> GetAll() 
            {
    		    return this.Repository.GetAll().ToList();
    		}
    				  public AddressBank GetByID(int ID)
            {
                return this.Repository.GetByID(ID);
            }
    		//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				   
    
    		public NAGFwk.Templates.AddressBank GetAddressBankWithAddress(int AddressID,int BankID) 
    		{
    		    return this.Repository.GetAddressBankWithAddress(AddressID,BankID);  
    		}			
    
    			  	    //*****************************************************************************************
    		//***************************CRUD Operations***********************************************
    		//*****************************************************************************************
    		#region "Delete"
    		
            public void DeleteLogical(int ID)
            {
                this.Repository.DeleteLogical(ID);
            }
    
    		 public void Delete(NAGFwk.Templates.AddressBank Obj)
            {
                Delete(Obj.AddressID,BankID);
            }
    
            public void DeleteLogical(NAGFwk.Templates.AddressBank Obj)
            {
                DeleteLogical(Obj.AddressID,BankID);
            }
    	
            public void Delete(int AddressID,int BankID) 
    		{
    			this.Repository.Delete(AddressID,BankID);  
    		}
    
    		//public void Delete(NAGFwk.Templates.AddressBank MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			//this.Repository.Delete(MyObj,Tran);  
    		//}
    
    		//public void TransactionalDelete(NAGFwk.Templates.AddressBank MyObj) 
    		//{
    			//this.Repository.TransactionalDelete(MyObj);  
    		//}
    		#endregion
    
    		#region "Insert"
    		 public void Insert(NAGFwk.Templates.AddressBank Obj)
            {       
                this.Repository.Insert(Obj);
            }
    			    //public NAGFwk.Templates.AddressBank Insert(NAGFwk.Templates.AddressBank MyObj) 
    		//{
    			//return this.Repository.Insert(MyObj);  
    		//}
    
    		//public IList<NAGFwk.Templates.AddressBank> Insert(List<NAGFwk.Templates.AddressBank> MyObjs) 
    		//{
    		//return	this.Repository.Insert(MyObjs);  
    		//}
    		
    		//public void Insert(NAGFwk.Templates.AddressBank MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			//this.Repository.Insert(MyObj,Tran);  
    		//}
    		
    		//public void TransactionalInsert(NAGFwk.Templates.AddressBank MyObj) 
    		//{
    			 //this.Repository.TransactionalInsert(MyObj);  
    		//}
    		#endregion
    
    		#region "Update"	
    		
    	    public void Update(NAGFwk.Templates.AddressBank MyObj) 
    		{
    			 this.Repository.Update(MyObj);  
    		}		
    		
    		//public void Update(NAGFwk.Templates.AddressBank MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			 //this.Repository.Update(MyObj,Tran);  
    		//}
    		
    		//public void TransactionalUpdate(NAGFwk.Templates.AddressBank MyObj) 
    		//{
    			 //this.Repository.TransactionalUpdate(MyObj);  
    		//}
    		#endregion
    
    }
}
namespace NAGFwk.BL
{
    using System;
    using System.Collections.Generic; 
    using NAGFwk.Templates;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    public partial class AddressCustomerController : NAGFwk.BL.IBaseController<Model.AddressCustomer>
    {
    
           private readonly SilkeyERP.Model.AddressCustomerRepository Repository;
    
            public AddressCustomerController()
            {
                    this.Repository = new Model.AddressCustomerRepository();
            }
    
    		public struct AddressCustomerRelatedEntities
            {
                			   
    			      public string Address { get { return "Address"; } }
    			          }
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public NAGFwk.Templates.AddressCustomer GetAddressCustomerWithAllChilds(int AddressID,int CustomerID) 
            {
    				 return this.Repository.GetAddressCustomerWithAllChilds(AddressID,CustomerID);
    		}
    			
            public NAGFwk.Templates.AddressCustomer GetAddressCustomer(int AddressID,int CustomerID) 
            {
    		    return this.Repository.GetAddressCustomer(AddressID,CustomerID); 
    		}
    				public List<NAGFwk.Templates.AddressCustomer> GetAll() 
            {
    		    return this.Repository.GetAll().ToList();
    		}
    				  public AddressCustomer GetByID(int ID)
            {
                return this.Repository.GetByID(ID);
            }
    		//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				   
    
    		public NAGFwk.Templates.AddressCustomer GetAddressCustomerWithAddress(int AddressID,int CustomerID) 
    		{
    		    return this.Repository.GetAddressCustomerWithAddress(AddressID,CustomerID);  
    		}			
    
    			  	    //*****************************************************************************************
    		//***************************CRUD Operations***********************************************
    		//*****************************************************************************************
    		#region "Delete"
    		
            public void DeleteLogical(int ID)
            {
                this.Repository.DeleteLogical(ID);
            }
    
    		 public void Delete(NAGFwk.Templates.AddressCustomer Obj)
            {
                Delete(Obj.AddressID,CustomerID);
            }
    
            public void DeleteLogical(NAGFwk.Templates.AddressCustomer Obj)
            {
                DeleteLogical(Obj.AddressID,CustomerID);
            }
    	
            public void Delete(int AddressID,int CustomerID) 
    		{
    			this.Repository.Delete(AddressID,CustomerID);  
    		}
    
    		//public void Delete(NAGFwk.Templates.AddressCustomer MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			//this.Repository.Delete(MyObj,Tran);  
    		//}
    
    		//public void TransactionalDelete(NAGFwk.Templates.AddressCustomer MyObj) 
    		//{
    			//this.Repository.TransactionalDelete(MyObj);  
    		//}
    		#endregion
    
    		#region "Insert"
    		 public void Insert(NAGFwk.Templates.AddressCustomer Obj)
            {       
                this.Repository.Insert(Obj);
            }
    			    //public NAGFwk.Templates.AddressCustomer Insert(NAGFwk.Templates.AddressCustomer MyObj) 
    		//{
    			//return this.Repository.Insert(MyObj);  
    		//}
    
    		//public IList<NAGFwk.Templates.AddressCustomer> Insert(List<NAGFwk.Templates.AddressCustomer> MyObjs) 
    		//{
    		//return	this.Repository.Insert(MyObjs);  
    		//}
    		
    		//public void Insert(NAGFwk.Templates.AddressCustomer MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			//this.Repository.Insert(MyObj,Tran);  
    		//}
    		
    		//public void TransactionalInsert(NAGFwk.Templates.AddressCustomer MyObj) 
    		//{
    			 //this.Repository.TransactionalInsert(MyObj);  
    		//}
    		#endregion
    
    		#region "Update"	
    		
    	    public void Update(NAGFwk.Templates.AddressCustomer MyObj) 
    		{
    			 this.Repository.Update(MyObj);  
    		}		
    		
    		//public void Update(NAGFwk.Templates.AddressCustomer MyObj, System.Data.Entity.DbContextTransaction Tran) 
    		//{
    			 //this.Repository.Update(MyObj,Tran);  
    		//}
    		
    		//public void TransactionalUpdate(NAGFwk.Templates.AddressCustomer MyObj) 
    		//{
    			 //this.Repository.TransactionalUpdate(MyObj);  
    		//}
    		#endregion
    
    }
}



//*****************************************************************************************
//********************************Functions Section****************************************
//*****************************************************************************************
          

